<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      class Person {
        username = "jack";
        constructor() {
          console.log(this.username);
        }
        say() {
          console.log(this.username);
        }
      }
      class User extends Person {
        username = "lili";
        constructor() {
          super();
          super.say();
        }
      }
      const u = new User();
      u.say();

      /*
        1. super()调用，this 指向父类
        2. super.方法名()调用，this 指向当前子类
        3. 对象.方法名()调用，this指向调用他的对象
      */
    </script>
  </body>
</html>
